home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Disks.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  120 lines

  1. /*
  2.      File:        Disks.h
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __DISKS__
  19. #define __DISKS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40.  
  41. enum {
  42.     sony                        = 0,
  43.     hard20                        = 1
  44. };
  45.  
  46. /*
  47.     Note:
  48.     
  49.     qLink is usually the first field in queues, but back in the MacPlus
  50.     days, the DrvSts record needed to be expanded.  In order to do this without
  51.     breaking disk drivers that already added stuff to the end, the fields 
  52.     where added to the beginning.  This was originally done in assembly language
  53.     and the record was defined to start at a negative offset, so that the qLink
  54.     field would end up at offset zero.  When the C and pascal interfaces where
  55.     made, they could not support negative record offsets, so qLink was no longer
  56.     the first field.  Universal Interfaces are auto generated and don't support
  57.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a 
  58.     none zero offset.  Assembly code which switches to Universal Interfaces will
  59.     need to compensate for that.
  60.  
  61. */
  62. struct DrvSts {
  63.     short                             track;                        /* current track */
  64.     char                             writeProt;                    /* bit 7 = 1 if volume is locked */
  65.     char                             diskInPlace;                /* disk in drive */
  66.     char                             installed;                    /* drive installed */
  67.     char                             sides;                        /* -1 for 2-sided, 0 for 1-sided */
  68.     QElemPtr                         qLink;                        /* next queue entry */
  69.     short                             qType;                        /* 1 for HD20 */
  70.     short                             dQDrive;                    /* drive number */
  71.     short                             dQRefNum;                    /* driver reference number */
  72.     short                             dQFSID;                        /* file system ID */
  73.     char                             twoSideFmt;                    /* after 1st rd/wrt: 0=1 side, -1=2 side */
  74.     char                             needsFlush;                    /* -1 for MacPlus drive */
  75.     short                             diskErrs;                    /* soft error count */
  76. };
  77. typedef struct DrvSts DrvSts;
  78.  
  79. struct DrvSts2 {
  80.     short                             track;
  81.     char                             writeProt;
  82.     char                             diskInPlace;
  83.     char                             installed;
  84.     char                             sides;
  85.     QElemPtr                         qLink;
  86.     short                             qType;
  87.     short                             dQDrive;
  88.     short                             dQRefNum;
  89.     short                             dQFSID;
  90.     short                             driveSize;
  91.     short                             driveS1;
  92.     short                             driveType;
  93.     short                             driveManf;
  94.     short                             driveChar;
  95.     char                             driveMisc;
  96. };
  97. typedef struct DrvSts2 DrvSts2;
  98.  
  99. extern pascal OSErr DiskEject(short drvNum);
  100.  
  101. extern pascal OSErr SetTagBuffer(void *buffPtr);
  102.  
  103. extern pascal OSErr DriveStatus(short drvNum, DrvSts *status);
  104.  
  105.  
  106. #if PRAGMA_ALIGN_SUPPORTED
  107. #pragma options align=reset
  108. #endif
  109.  
  110. #if PRAGMA_IMPORT_SUPPORTED
  111. #pragma import off
  112. #endif
  113.  
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117.  
  118. #endif /* __DISKS__ */
  119.  
  120.